package com.longge;

public class FindTheArrayConcVal {

    public long findTheArrayConcVal(int[] nums) {

        int left = 0, right = nums.length - 1;
        long sum = 0;

        while (left < right) {
            String connect = String.valueOf(nums[left]) + nums[right];
            long num = Long.parseLong(connect);
            sum += num;
            left++;
            right--;
        }
        if (left == right) {
            sum += nums[left];
        }
        return sum;

    }

}
